//! @author Adam Emil Skoog
//! @date   2012-01-05

#ifndef KEDJA_KEY_INPUT_EVENT_RECEIVER_H_
	#define KEDJA_KEY_INPUT_EVENT_RECEIVER_H_
	#include "EventReceiver.h"
	#include "EventManager.h"

	namespace kedja
	 {
		/**
		 * Event receiver for handling mouse input.
		 */
		class KeyInputEventReceiver : public EventReceiver
		 {
			public:
				// Declare functions.
				KeyInputEventReceiver();
				void registerOnKeyPress(void (*function)(const sf::Key::Code &));
				void deregisterOnKeyPress();
				void registerOnKeyRelease(void (*function)(const sf::Key::Code &));
				void deregisterOnKeyRelease();

			private:
				// Receivers.
				static std::vector<KeyInputEventReceiver *> *keyInputEventReceivers;

				// Functions.
				void (*onKeyPress)(const sf::Key::Code &);
				void (*onKeyRelease)(const sf::Key::Code &);

				// Declare functions.
				static void initialise();
				static void deinitialise();
				static KeyInputEventReceiver *const getKeyInputEventReceiver(const unsigned &);
				static const unsigned getKeyInputEventReceiverCount();

			friend class EventManager;
			friend class Component;
		 };
	 }
#endif

